<?
 
$action = "Play";
$icon = "";
$icon .= sprintf("<img onclick='ArticleAdvance(-1)' id='i.prev' src='/request/icon/button/%s.png' align='absmiddle' />", 
                          'previous');

$icon .= sprintf("<img onclick='ArticlePlay()' id='i.play' src='/request/icon/button/%s.png/caption/%s' align='absmiddle' />", 
                          strtolower($action), $action);

$icon .= sprintf("<img onclick='ArticleAdvance(1)' id='i.inext' src='/request/icon/button/%s.png' align='absmiddle' />", 
                          'next');

?>

<h2>

<a href="/">Home</a> &#187; 
<a href="/favorites/home/page/<?= $this->page ?>/group/<?= $this->group ?>">Bookmarks</a> &#187;

 
 <input value="<?= $this->group ?>" id="gn" type="hidden"/>
 

<select id="drp" onchange="LoadPicturebyKey(this.options[this.selectedIndex].value)">

<? for ($x=0;$x<sizeof($this->items);$x++):
    $item = $this->items[$x]; ?>

<option value="<?= $item->id ?>"

<? if ($item->id==$this->item): ?> 
selected
<? endif ?>

><?=  deSubject(html_entity_decode($item->subject)) ?></option>

<? endfor ?> 


</select>
 <?= $icon ?>
</h2>

<h1>
<table align="center"><tr>
<td><div id="dbx" class="shadow-black" style="color:white;"></div></td>
<td>
 <?   for ($i=0;$i<PREVIEW_COUNT;$i++): ?>

<div id="pr<?= $i ?>" 
  style="float:left;width:48px;height:48px;background-repeat:no-repeat;background-size:48px;overflow:hidden"
  onclick="var d=$('drp');d.selectedIndex+=<?= $i - 4 ?>;LoadPicturebyKey(d.options[d.selectedIndex].value)">


<img id="im<?= $i ?>" src="/images/clear.gif" width="48"/>


</div> 
<? endfor ?>

</td></tr></table>
</h1>


<?

    if (is_array ($this->Persisted))  
        echo $this->partial( "persist.phtml", array("Persisted"=>$this->Persisted)); 
    echo $this->partial ("viewer.phtml", array("group"     => $this->group,
                                                 "item"      => $this->item ,
                                                 "subject"   => $this->subject  ));
?>


<script language="javascript">
    $('i.play').invoke = function () {
        var on  = "/request/icon/button/play.png/caption/Play";
        var off = "/request/icon/button/stop.png/caption/Stop";
        this.src = bPlaying ? off : on;
    }
    ServiceBus.Subscribe ('OnPlay', $('i.play'));
</script>















